package com.dimples.dd.web.exception;

import com.dimples.dd.common.core.IMsgCode;
import lombok.Data;

import java.io.Serial;

/**
 * 验证码类型异常
 *
 * @author zhongyj <1126834403@qq.com><br/>
 * @date 2024/6/18
 */
@Data
public class ValidateCodeException extends RuntimeException {

    @Serial
    private static final long serialVersionUID = -2586863328185239413L;

    public IMsgCode resultCode;

    /**
     * 空构造方法，避免反序列化问题
     */
    public ValidateCodeException() {
    }

    public ValidateCodeException(IMsgCode errorCode) {
        super(errorCode.getMsg());
        this.resultCode = errorCode;
    }

    public ValidateCodeException(String message) {
        super(message);
    }
}
